package com.lupan.tomcatStudy.springCode.beanLoad;

import org.springframework.beans.factory.FactoryBean;

/**
 * 说明：
 *
 * @author lupan
 * @version 2017/6/9 9:59
 */
public class CarBeanFactory  implements FactoryBean<Car>{

    private String brand;
    private double price;

    @Override
    public Car getObject() throws Exception {
        Car car = new Car();
        car.setBrand(brand);
        car.setPrice(price);
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}


